<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="js/jquery-1.8.3.min.js"></script>
<body>


<button onclick="btnClick()">点击一下</button>
<script>
    function btnClick() {
        $.ajax({
            url: "http://localhost:8080/getMsg",
            type:"get",
            success: function (data){
                alert(data)
            }
        })
    }
</script>

</body>
</html>
